fb_tl <-
function(Genus = NA, Species = NA, server = 'http://www.fishbase.tw/')
	{
require("XML")
require("stringr")
require('RCurl')

	tl <- matrix(data = NA, nrow = 1, ncol = 2)
	url <- NA;
  if (is.na(Genus) | is.na(Species))
		{
		print("The Genus and Species are needed!!")
		}
	if (!is.na(Genus) & !is.na(Species)) 
		{
		url <- paste(server, "Summary/",Genus,"-",Species, ".html", sep = "")
		}
	if (!is.na(url))
		{
		g <- htmlParse(url)
		g2 <- toString.XMLNode(g)
		g3 <- toString(str_replace_all(str_replace_all(str_replace_all(g2, "\t", ""), "\n", ""), "\r", ""))
		g4 <- strsplit(g3, "Trophic Level")[[1]][2]
		g5 <- strsplit(g4,"<!-- End Trophic -->")[[1]][1]
		g6 <- str_replace_all(g5, "</span>", "")
		g6 <- str_replace_all(g6, "</tr>", "")
		g6 <- str_replace_all(g6, "</td>", "")
		g6 <- str_replace_all(g6, "</div>", "")
		g6 <- str_replace_all(g6, "<br>", "")
		g6 <- str_replace_all(g6, "<tr>", "")
		g6 <- str_replace_all(g6, "<dr>", "")
		g7 <- strsplit(g6,"<span class=\"sleft \">")[[1]][2]
		g7 <- strsplit(g7," Based ")[[1]][1]
		tl[1,1] <- unlist(as.numeric(strsplit(g7, " s.e. ")[[1]][1]))
		tl_se <- strsplit(g7, " s.e. ")[[1]][2]
		tl[1,2] <- as.numeric(unlist(tl_se))
		tl <- as.data.frame(tl)
		names(tl) <- c("tl", "tl_se")
		}
	return(tl)
	}
